#include "pausemenu.h"

PauseMenu::PauseMenu(QWidget* parent):QWidget(parent) {
    QVBoxLayout* layout=new QVBoxLayout(this);

    pauseLabel=new QLabel("The_World!",this);
    pauseLabel->setAlignment(Qt::AlignCenter);
    pauseLabel->setStyleSheet("font-size: 48px;font-weight:bold;");

    resumeButton=new QPushButton("时间开始流动",this);
    resumeButton->setStyleSheet("font-size:24px;padding:10px");

    menuButton=new QPushButton("返回主菜单",this);
    menuButton->setStyleSheet("font-size:24px;padding:10px");

    layout->addStretch();
    layout->addWidget(pauseLabel);
    layout->addStretch();
    layout->addWidget(resumeButton);
    layout->addWidget(menuButton);
    layout->addStretch();

    connect(resumeButton,&QPushButton::clicked,this,&PauseMenu::resumeGame);

    connect(menuButton,&QPushButton::clicked,this,&PauseMenu::returnToMenu);
}

void PauseMenu::setPauseText(){
    pauseLabel->setText("The_World!");
}
